package cn.sdormitory.controller;


import cn.sdormitory.academic.entity.ClsPracticeInfo;
import cn.sdormitory.academic.vo.ClsPracticeInfoQueryVo;
import cn.sdormitory.common.api.CommonResult;
import cn.sdormitory.service.AppClsPracticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Api(tags = "app => 上机数据")
@RestController
@RequestMapping("/app/clsPractice")
public class AppClsPracticeController {

    @Autowired
    AppClsPracticeService appClsPracticeService;

    @ApiOperation("查询上机练习数据")
    @PostMapping("/findClsPracticeList")
    public CommonResult findClsPracticeList(@RequestBody ClsPracticeInfoQueryVo vo){
        List<ClsPracticeInfo> clsPracticeList = appClsPracticeService.findClsPracticeList(vo);
        return CommonResult.success(clsPracticeList);
    }

    @ApiOperation("根据上机练习信息id查询详细表信息")
    @GetMapping("/findClsPracticeDetails/{clsPracticeInfoId}")
    public CommonResult findClsPracticeDetails(@PathVariable Long clsPracticeInfoId){
        return CommonResult.success(appClsPracticeService.findClsPracticeDetails(clsPracticeInfoId));
    }
}
